package com.ymttest.database.sqlwapper;

import java.util.ArrayList;
import java.util.List;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;
import com.ymttest.database.model.SmsLog;
import com.ymttest.utils.EnvSetup;

public class SmsLogWapper {

	SqlManager manage;

	public SmsLogWapper() {
		manage = new SqlManager("ymt" + EnvSetup.getEnv());
	}

	/**
	 * 根据phone 查询smslog信息,返回最新的4条信息
	 * 
	 * @param phone
	 * @return Smslog
	 * @throws InterruptedException
	 */
	public List<SmsLog> selectByPhone(String phone) throws InterruptedException {
		List<SmsLog> smsLogList = manage.getSelectResults("com.ymttest.database.mapping.SmsLogMapper.selectByPhone",
				phone);
		return smsLogList;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		List<SmsLog> smss = new ArrayList<SmsLog>();

		try {
			smss = new SmsLogWapper().selectByPhone("13701730723");
		} catch (InterruptedException e) {

			e.printStackTrace();
		}
		for (SmsLog s : smss) {
			Logger.debug("addtime:" + s.getAddtime());
			Logger.debug("supply:" + s.getMessagesupply());
		}

	}

}
